package com.eureka;

import com.google.common.collect.ImmutableMap;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 提供给服务调用者eureka-service-invoker调用
 * Created by earl on 2018/4/17.
 */
@RequestMapping("/provider")
@RestController
public class ProviderController {



    @PutMapping("/person/{id}")
    public Person person(@PathVariable Long id, @RequestBody Person person,HttpServletRequest request){
        person.setName(request.getRequestURL().toString());
        person.setId(id);
        return person;
    }

    @GetMapping("/hello")
    public String hello( HttpServletRequest request){
        return   request.getRequestURL().toString() ;
    }


}
